<style>
.setimg{
	margin:-2px 5px 0 0 
}
a:hover{
	cursor:pointer;
}
.color_red{
	color: red;
}
.color_purple{
	color: purple;
}
.color_orange{
	color: orange;
}


#addform .file{
	position: relative;
}
#addform .file span{
	position: absolute;
	right: 80px;
	top: 15px;
	background-color: #414959;
	padding: 2px 6px;
	height: 23px;
	line-height: 23px;
	cursor: pointer;
	color: #fff;
	font-size: 14px;
	overflow: hidden;
	background-image: linear-gradient(to bottom, #6c7994, #414959);
	border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
	border: 1px solid #363d4a;
	display: inline-block;
	*display: inline;
	*zoom: 1;
}
#addform .file span input{
	position: absolute;
	font-size: 100px;
	left: 0;
	top: 0;
	opacity: 0;
	filter: alpha(opacity=0);
	cursor: pointer;
}
</style>
<div class="row-fluid">
	<a style="border:1px solid #ccc" class="block-heading" data-toggle="collapse">列表数据</a>
    <div class="well">
	<button class="btn btn-primary ifrm" data-url="/drug/addDrug" data-width="720" data-height="570" data-title="药品入库" data-params="" style="float:right;padding:3px 6px">药品入库</button>

	    <div class="btn-toolbar">
		    <form>
		    	<label style="display: inline;margin-left:10px">药品编号：</label>
		    	<input class="input input-medium" type="text" name="drug_no" value="<?=I('get.drug_no')?>" style="width: 120px;"/>

				<label style="display: inline;margin-left:10px">药品名称：</label>
		    	<input class="input input-medium" type="text" name="drug_name" value="<?=I('get.drug_name')?>" style="width: 120px;"/>

				<label style="display: inline;margin-left:10px">所属仓库：</label>
				<select name="warehouse" class="warehouse" style="width:100px;">
					<option value="">仓库/全部</option>
					<foreach name="warehouse" item="vo" key="ke">
						<option value="<?=$vo['warehouse_id']?>" <?=$vo['warehouse_id'] == I('get.warehouse')? 'selected': ''?>><?=$vo['warehouse_name']?></option>
					</foreach>
				</select>

				<label style="display: inline;margin-left: 15px">入库时间：</label><input readonly name="stime" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" placeholder="开始时间" value="<?=I('get.stime')?>" style="width: 100px;"/>&nbsp;
				<input readonly style="margin-left:10px;width: 100px;" name="etime" placeholder="结束时间" class="input input-medium" onclick='WdatePicker({dateFmt:"yyyy-MM-dd"})' type="text" value="<?=I('get.etime')?>" />
		    	<input type="hidden" value="<?=I('get.res')?>" name="res" />
		    	<button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
		    </form>
		</div>

		<hr>
		<table class="table">
		      <thead>
		        <tr>
		          <th style="text-align:center;width:100px">序号</th>
		          <th style="text-align:center;width:170px">药品编号</th>
		          <th style="text-align:center;width:170px">种类</th>
		          <th style="text-align:center;width:170px">名称</th>
		          <th style="text-align:center;width:170px">规格型号</th>
		          <th style="text-align:center;width:170px">单位</th>
		          <th style="text-align:center;width:170px">入库数量</th>
		          <th style="text-align:center;width:170px">仓库</th>
		          <th style="text-align:center;width:170px">入库人</th>
		          <th style="text-align:center;width:170px">备注</th>
		          <th style="text-align:center;width:140px">入库日期</th>
		          <th style="text-align:center;width:140px">操作账号</th>
		      	  <th style="text-align:center;width:130px">操作</th>
		        </tr>
		      </thead>
		      <tbody>
		      	<?php if($getData){foreach($getData AS $key=>$val){ ?>
		        <tr> 
		          <td style="text-align:center;vertical-align:middle;"><?=$val['id']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['drug_no']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['type']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['drug_name']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['drug_size']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['drug_unit']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['in_stock']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['warehouse']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['storage_name']?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=$val['remark']?htmlspecialchars_decode($val['remark']):'-'?></td>
		          <td style="text-align:center;vertical-align:middle;"><?=date('Y-m-d',$val['add_at'])?></td>
					<td style="text-align:center;vertical-align:middle;"><?=$val['operator']?></td>

					<td style="text-align:center;vertical-align:middle;">
		              <!--<a class="ifrm btn btn-info" href="javascript:void(0)" data-url="/drug/addDrug" style="padding: 0px 4px;" data-width="680" data-height="460" data-title="修改信息" data-params="id/<?=$val['id']?>">修改</a>&nbsp;&nbsp;-->
					  <a href="/drug/delInstock?id=<?=$val['id']?>" style="padding: 0px 4px;" class="decate btn btn-danger" title="删除" role="button" data-toggle="modal">删除</a>&nbsp;
				 </td>
		        </tr>
		        <?php }}else{?>
		        	<tr><td style="text-align:center" colspan=13>暂无数据</td></tr>
		        <?php }?>
		      </tbody>
		   </table>
		   <span style="float:right;margin-top:-44px"><?=$page?></span>
	</div>
</div>
<script>
$(function(){
	$('.decate').live('click',function(){
		if(!window.confirm('确认删除吗 ?')){
			return false;
		}
		window.location = $(this).attr('href');
	});
})
</script>
